.RECIPEPREFIX +=

PYTHON=python
#ROOT=data/WIDER
ROOT = data/widerface
TRAINDATA=$(ROOT)/wider_face_split/wider_face_train_bbx_gt.txt
VALDATA=$(ROOT)/wider_face_split/wider_face_val_bbx_gt.txt
TESTDATA=$(ROOT)/wider_face_split/wider_face_test_filelist.txt

CHECKPOINT=weights/checkpoint_12.pth
GROUND_DIR = $(ROOT)/wider_face_split/
PREDICT_DIR = ./val_results/
main:
  $(PYTHON) main.py $(TRAINDATA) $(VALDATA) --dataset-root $(ROOT)
resume:
  $(PYTHON) main.py $(TRAINDATA) $(VALDATA) --dataset-root $(ROOT) --resume $(CHECKPOINT) --epochs $(EPOCH)
evaluate:
  $(PYTHON) evaluate.py $(VALDATA) --dataset_root $(ROOT) --checkpoint $(CHECKPOINT) --split val
evaluate_nohup:
  nohup $(PYTHON) evaluate.py $(VALDATA) --dataset-root $(ROOT) --checkpoint $(CHECKPOINT) --split val &
# evaluate_one:
#   ROOT = sample
#   TRAINDATA=$(ROOT)/wider_face_split/wider_face_train_bbx_gt.txt
#   VALDATA=$(ROOT)/wider_face_split/wider_face_val_bbx_gt.txt
#   TESTDATA=$(ROOT)/wider_face_split/wider_face_test_filelist.txt
#   $(PYTHON) evaluate.py $(VALDATA) --dataset-root $(ROOT) --checkpoint $(CHECKPOINT) --split val

evaluation:
  $(PYTHON) ./eval_tools/wider_eval.py -g $(GROUND_DIR) -p $(PREDICT_DIR) -f ./result
test:
  $(PYTHON) evaluate.py $(TESTDATA) --dataset_root $(ROOT) --checkpoint $(CHECKPOINT) --split test

cluster:
  cd utils; $(PYTHON) cluster.py $(TRAIN_INSTANCES)

debug:
  $(PYTHON) main.py $(TRAINDATA) $(VALDATA) --dataset-root $(ROOT) --batch_size 1 --workers 0 --debug

debug-evaluate:
  $(PYTHON) evaluate.py $(VALDATA) --dataset-root $(ROOT) --checkpoint $(CHECKPOINT) --split val --batch_size 1 --workers 0 --debug

clean:
  rm -rf ./sample
  mkdir sample